import { getLocal, getSession, setLocal, setSession } from "./utils";



export const getEnvId = ():number =>{
    const env = getLocal("envId")
    return Number(env)
}
export const setEnvId = (envId:number):void =>{
    setLocal('envId', envId+'')
}

export const getProductId = ():number|undefined =>{
    const res = getLocal("product_id")
    if(res){
        return Number(res)
    }
    return undefined
}
export const setProductId = (param:number|undefined):void =>{
    setLocal('product_id', param+'')
}

export const getProjectId = ():number|undefined =>{
    const res = getLocal("project_id")
    if(res){
        return Number(res)
    }
    return undefined
}
export const setProjectId = (param:number|undefined):void =>{
    setLocal('project_id', param+'')
}

export const getModuleId = ():number|undefined =>{
    const res = getLocal("module_id")
    if(res){
        return Number(res)
    }
    return undefined
}
export const setModuleId = (param:number|undefined):void =>{
    setLocal('module_id', param+'')
}

export const logIsEndStatus = (parm: string): boolean => {
    return parm ==='成功' || parm === '失败'
}